﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CustomsSystem.DAL;
using CustomsSystem.Model;
using System.Data;

namespace CustomsSystem.BLL
{
    public class ScoreManage
    {
        private readonly ScoreService dal = new ScoreService();

        /// <summary>
        /// 增加一条评论
        /// </summary>
        public bool Add(CustomsSystem.Model.Score model)
        {
            if (dal.Add(model) == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 是否存在评论记录
        /// </summary>
        public bool Exists(int? ID)
        {
            if (dal.Exists(ID) == true)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CustomsSystem.Model.Score GetModel(int ID)
        {
            return dal.GetModel(ID);
        }
        public CustomsSystem.Model.Score GetModel(DataTable dt)
        {
            return dal.DataRowToModel(dt.Rows[0]);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }

        /// <summary>
        /// 增加处理意见
        /// </summary>
        public bool Revise(CustomsSystem.Model.Score model)
        {
            return dal.Revise(model);
        }

        /// <summary>
        /// 是否存在处理意见
        /// </summary>
        public bool Exists(int? sheetID,string handle)
        {
            if (dal.Exists(sheetID,handle) == true)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
